<?php
header ( "Content-Type: text/html; charset=utf-8" );
require_once("config.inc.php");
require(COMM_PATH.'chinese-unicode.php'); 

$pdf=new PDF_Unicode(); 

$pdf->Open(); 
$pdf->AddPage(); 
$pdf->AddUniCNShwFont('uni'); 
$pdf->SetFont('uni','',18); 
$title = "本文用UTF8做為中文字編碼";
$author = "同樣的FPDF函";
$wtiltle = $pdf->GetStringWidth($title);
$wauthor = $pdf->GetStringWidth($author);
$pdf->SetX(1);
$pdf->Cell ($wtiltle, 10, $title,1,0,"L");
$pdf->SetX(210-($wauthor+1));
$pdf->Cell ($wauthor, 10, $author,1,0,"R");
$pdf->Ln();
$pdf->Line(0,20,210,20);
$pdf->Output("pdf.pdf","I");
?>